<!DOCUMENT HTML>
<html>
    <head><title> Lista de Fotos</title></head>

    <body>
        <?php
        session_start();
        require 'checksLogged.php';
        include 'menu.php';
        require 'action/listImagetempAction.php';
        ?>
        <br>
        <br>


        <form id="form" name="upload" method="POST" action="action/insertImageAction.php" enctype="multipart/form-data" >

            <br>
            <label>Nome do Album</label>
            <br>
            <input type="text" name="album"   id="legend" value="<?php echo $_POST['album']; ?>"  />

            <?php
            if ($novoFile) {
                for ($i = 0; $i < count($novoFile); $i++) {
                    ?>
                    <br>
                    <img src="<?php echo 'temp/' . $novoFile[$i] ?>" width=80 height=80 border=3 >
                    <label>Capa</label>
                    <input type="checkbox" name="capa" id="capa" value=<?php echo $novoFile[$i]; ?>
                           </a>
                    <br>
                    <br>

                    <input type="text" name="legend[]"   id="legend"  />
                    <input type="hidden" name="fotoname[]"   id="name" value="<?php echo $novoFile[$i] ?> " />
                    <input type="hidden" name="fototype[]"   id="type" value="<?php echo $newFileType[$i] ?>" />
                    <br>

                    <?php
                }
            } else if ($fotosExistentes > 0) {

                foreach ($fotosExistentes as $foto) {
                    $mesagem.='\n' . $foto;
                }
                $mesagem.='\n';

                echo"<script> alert('Fotos:$mesagem já cadastradas.'); 
          window.location='listAllPhotos.php';</script>";
            }
            else
                echo"Nem um registro encontrado.";
            ?>


            <input name="enviar" type="submit" id="enviar" value="Enviar..." /> 
        </form>
    </body>

</html>
